<%
# Copyright (C) 2017 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% form ||= nil %>
<% course ||= nil %>
<% master_template = course.master_course_templates.for_full_course.first %>
<% default_restrictions = master_template&.default_restrictions || { :content => true } %>
<div id="master_course_restrictions" class="master_course_restrictions">
  <fieldset class="ic-Fieldset ic-Fieldset--radio-checkbox">
    <legend class="ic-Legend">
      <span class="master-course-cell"><i class="icon-blueprint-lock"></i></span>
      {{#t}}Locked object configuration:{{/t}}
    </legend>
    <div class="ic-Checkbox-group">
      <%= form.fields_for :blueprint_restrictions do |f| %>
        <div class="ic-Form-control ic-Form-control--checkbox">
          <%= f.check_box :content, :checked => default_restrictions[:content] %>
          <%= f.label :content, :class => 'ic-Label', :en => "Content" %>
        </div>
        <div class="ic-Form-control ic-Form-control--checkbox">
          <%= f.check_box :points, :checked => default_restrictions[:points] %>
          <%= f.label :points, :class => 'ic-Label', :en => "Points" %>
        </div>
        <div class="ic-Form-control ic-Form-control--checkbox">
          <%= f.check_box :due_dates, :checked => default_restrictions[:due_dates] %>
          <%= f.label :due_dates, :class => 'ic-Label', :en => "Due Dates" %>
        </div>
        <div class="ic-Form-control ic-Form-control--checkbox">
          <%= f.check_box :availability_dates, :checked => default_restrictions[:availability_dates] %>
          <%= f.label :availability_dates, :class => 'ic-Label', :en => "Availability Dates" %>
        </div>
      <% end %>
    </div>
  </fieldset>
</div>
